<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 50px;
            border: 1px solid red;
            border-radius: 10px;
        }

        .level {
            height: 100%;
            width: 50%;
            border-radius: 10px;
            background-color: red;
            transition: width 0.5s;
        }

        .box:hover .level {
            width: 75%;
        }
    </style>
    <script>
        alert('你好');
        alert('我也好');
    </script>
</head>

<body>
    <div class="box">
        <div class="level">

        </div>
    </div>
</body>

</html>